/*
 * Copyright © 2017 eqxiu.com 北京中网易企秀科技有限公司  All rights reserved.
 */

package cn.hermit.nio.http.server.rest.bookstore;

import cn.hermit.nio.http.server.rest.annotation.Property;
import cn.hermit.nio.http.server.rest.annotation.Schema;
import cn.hermit.nio.http.Http;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author JackGao 高建国
 * @description //TODO 设计说明
 * @date 30/5/2017
 */
@Schema
public class Book {

    private AtomicInteger counter = new AtomicInteger(0);

    private long id;

    private String name;

    private String author;

    @Property(realType = Http.ParamRealType.DATE)
    private String publishDate;

    private String description;

    public Book(String name, String author, String description) {
        this.id = counter.incrementAndGet();
        this.name = name;
        this.author = author;
        this.publishDate = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(Calendar.getInstance().getTime());
        this.description = description;
    }


}
